import request from '@/config/axios'

// 激活码管理 VO
export interface ActivationVO {
  id: number // 主键id
  activationCode: string // 激活码
  beginTime: Date // 有效期开始
  endTime: Date // 有效期结束
}

// 激活码管理 API
export const ActivationApi = {
  // 查询激活码管理分页
  getActivationPage: async (params: any) => {
    return await request.get({ url: `/member/activation/page`, params })
  },

  // 查询激活码管理详情
  getActivation: async (id: number) => {
    return await request.get({ url: `/member/activation/get?id=` + id })
  },

  // 新增激活码管理
  createActivation: async (data: ActivationVO) => {
    return await request.post({ url: `/member/activation/create`, data })
  },

  // 修改激活码管理
  updateActivation: async (data: ActivationVO) => {
    return await request.put({ url: `/member/activation/update`, data })
  },

  // 删除激活码管理
  deleteActivation: async (id: number) => {
    return await request.delete({ url: `/member/activation/delete?id=` + id })
  },

  // 导出激活码管理 Excel
  exportActivation: async (params) => {
    return await request.download({ url: `/member/activation/export-excel`, params })
  }
}
